package com.lyj.io.module.sys.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;


/**
 * 系统日志
 * @author:liyajie
 * @createTime:2022/1/5 11:23
 * @version:1.0
 */
@ApiModel("日志表")
@Data
@TableName("sys_log")
public class SysLog implements Serializable {
	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "日志id", example = "")
	@TableId(type = IdType.ASSIGN_ID)
	private Long id;

	/**
	 * 用户名
	 */
	@ApiModelProperty(value = "用户名", example = "")
	@TableField(value = "USERNAME")
	private String username;

	/**
	 * 用户操作
	 */
	@ApiModelProperty(value = "用户操作", example = "")
	@TableField(value = "OPERATION")
	private String operation;

	/**
	 * 请求方法
	 */
	@ApiModelProperty(value = "请求方法", example = "")
	@TableField(value = "METHOD")
	private String method;

	/**
	 * 请求参数
	 */
	@ApiModelProperty(value = "请求参数", example = "")
	@TableField(value = "PARAMS")
	private String params;

	/**
	 * 请求结果
	 */
	@ApiModelProperty(value = "请求结果", example = "")
	@TableField(value = "RESULT")
	private String result;

	/**
	 * 执行时长(毫秒)
	 */
	@ApiModelProperty(value = "执行时长(毫秒)", example = "")
	@TableField(value = "TIME")
	private Long time;

	/**
	 * IP地址
	 */
	@ApiModelProperty(value = "IP地址", example = "")
	@TableField(value = "IP")
	private String ip;

	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间", example = "")
	@TableField(value = "CREATE_DATE", fill = FieldFill.INSERT)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
	private Date createDate;
}
